<!--<div class="span12">
	<ul class="breadcrumb">
	  <li>
	  	<?php echo $this->Html->link('Usuarios Sistema', array('controller'=>'users', 'action'=>'sisusers'));?>
	  	<span class="divider">/</span>
	  </li>
	  <li class="active">Usuarios<span class="divider"></span></li>
	 
	</ul>
</div>-->
	
<div class='span12'>
	<h1><?php echo $this->Html->link($page_title, '/'); ?></h1>
	<div class="btn-group">
	 <!-- <?php echo $this->Html->link('Nuevo Usuario', array('controller'=>'users', 'action'=>'add'),array('class'=>'btn btn-success'));?>
	  <span class="divider">|</span>
	  <a href="#" id='edit_bt' class="btn btn-success">Editar</a>
	  <span class="divider">/</span>
	  <a href="#" id='delete_bt' class="btn btn-success">Eliminar</a>-->
	</div>
	<hr>
	<table class="table table-bordered">
		<thead>
			<tr>
				<th>-</th>
				<th>Name</th>
				
				<th>Estado</th>
				<th>Creado</th>
			</tr>
		</thead>
		<tbody>
			<?php foreach($tablestypes as $table):?>
				<tr>
					<td>
						<input type='checkbox' name='tabletype[]' value='<?php echo $table['TableType']['id']?>' > </td>
					<td><?php echo $table['TableType']['name']?></td>
					<td><?php echo $table['TableType']['status']?></td>
					<td><?php echo $table['TableType']['created']?></td>

				</tr>
			<?php endforeach;?>
		</tbody>
	</table>
	
</div>	
<br>
<br>
<br>
<br>
<br>
<br>



<script type="text/javascript">
  $(function(){
    function get_check_id(){
        var result=0;
        $('input[type="checkbox"]').each(function() {
            if( $(this).is(":checked")){
                var user_id = $(this).val();
                // window.location.replace("/backend/users/contact/"+user_id);
                result =  user_id;
            }
        });
        return result;
    }

    $("#edit_bt").click(function()
    {
	    var eid= get_check_id();
	    if (eid != 0)
        {
        	console.debug("testing");
        	window.location.replace("users/edit/"+eid);
        }
    });
    $("#delete_bt").click(function()
    {
	    var eid= get_check_id();
	    if (eid != 0)
        {
        	console.debug("testing");
        	window.location.replace("users/delete/"+eid);
        }
    });

  });

</script>